package b1.scenes.fight
{
	import b1.conifg.*;
	import b1.controls.basic.RoundRec;
	import b1.net.*;
	import b1.players.AnimalInfo;
	
	import flash.display.Sprite;
	import flash.text.*;


	public class AnimalTip extends Sprite
	{		
		public function AnimalTip(animalInfo:AnimalInfo, leftFlag:Boolean)
		{
			super();
			var roundRec:RoundRec = new RoundRec(130, 150, 0.8, 0x8080FF);
			addChild(roundRec);
			
			var initX:int = 10;
			var initY:int = 7;
			
			//名字
			var nameText:TextField = new TextField();
			nameText.selectable = false;
        	nameText.autoSize = TextFieldAutoSize.CENTER;
			nameText.defaultTextFormat = new TextFormat("微软雅黑", 15, 0x000000, true);
			nameText.text = animalInfo.ownerName.substr(0,4) + "的" + animalInfo.animalName;
			nameText.x = initX;
			nameText.y = initY;
			addChild(nameText);
			
			//血量，体力，等级，经验，智力，速度
			var levelText:TextField = new TextField();
			levelText.selectable = false;
        	levelText.autoSize = TextFieldAutoSize.LEFT;
			levelText.defaultTextFormat = new TextFormat("微软雅黑", 13, 0x000000);
			levelText.appendText("等级" + ": " + animalInfo.level.toString() + "\n");
			levelText.appendText("血量" + ": " + animalInfo.healthPoint.toString() + " / " + animalInfo.healthPointMax.toString() + "\n");
			levelText.appendText("体力" + ": " + animalInfo.vitalityPoint.toString() + " / " + animalInfo.vitalityPointMax.toString() + "\n");
			levelText.appendText("速度" + ": " +  animalInfo.speed.toString() + "\n");
			levelText.appendText("智力" + ": " + animalInfo.intelligence.toString() + "\n");
			levelText.x = initX;
			levelText.y = initY + 25;
			addChild(levelText);
		}
		
	}
}